<extend name="./public/frame.html"/>
<block name="content">
    <table class="layui-table" lay-size="sm" style="margin-bottom: 15px">
        <tr>
            <td colspan="10" style="color: green;">订单明细</td>
        </tr>
        <tr>

            <td style="width:15%;text-align: center;">订单号</td>
            <td><?php echo $result['order_sn'];?></td>
        </tr>
        <?php if(!empty($result['abnormal_order'])):?>
        <tr>
            <td style="width:10%;text-align: center;">状态</td>
            <td style="color: red;"><?php echo $result['abnormalName'];?></td>
            <td style="width:10%;text-align: center;">异常原因</td>
            <td><?php echo $result['abnormal_reason'];?></td>
        </tr>
        <?php endif;?>
        <tr>
            <td style="width:15%;text-align: center;">城市</td>
            <td><?php echo $result['start_name'];?></td>
            <td style="width:15%;text-align: center;">订单状态</td>
            <td>
                <?php echo  $orderStatusName[$result['order_status']];?>
            </td>
        </tr>
        <tr>
            <td style="width:15%;text-align: center;">乘客手机号</td>
            <td><?php echo $result['passenger_phone'];?></td>
            <td style="width:15%;text-align: center;">下单时间</td>
            <td><?php echo date('Y-m-d H:i:s',$result['order_time']);?>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: green;">预约时间：</span><?php echo $result['book_time'];?></td>
        </tr>
        <tr>
            <td style="width:15%;text-align: center;">出发地</td>
            <td><?php echo $result['start_name'];?></td>
            <td style="width:15%;text-align: center;">目的地</td>
            <td><?php echo $result['arrive_name'];?></td>
        </tr>
        <tr>
            <td style="width:15%;text-align: center;">费用</td>
            <td><?php echo  number_format($result['original_price']/100,2);?></td>
        </tr>
        <?php if(in_array($result['order_status'],[5,10,15])):?>
        <tr>
            <td style="width:15%;text-align: center;">取消原因</td>
            <td><?php echo $orderStatusName[$result['order_status']];?></td>
            <td style="width:15%;text-align: center;">取消时间</td>
            <td>
                <?php echo  date('Y-m-d H:i:s',$result['cancel_time']);?>
            </td>
        </tr>
        <?php if(in_array($result['orderStatus'],[12])):?>
        <tr>
            <td style="width:15%;text-align: center;">取消费用</td>
            <td><?php echo $result['user_price'];?></td>
            <td style="width:15%;text-align: center;">支付状态</td>
            <td><?php echo $result['payStatusInfo'];?></td>
        </tr>
        <?php if($result['payStatus'] == 1):?>
        <tr>
            <td style="width:15%;text-align: center;">支付时间</td>
            <td><?php echo $result['payTimeInfo'];?></td>
            <td style="width:15%;text-align: center;">支付方式</td>
            <td><?php echo $result['payTypeInfo'];?></td>
        </tr>
        <?php endif;?>
        <?php endif;?>
        <?php endif;?>

        <?php if($result['orderStatus'] >= 16):?>
        <?php if($result['book'] == 1):?>
        <!--预约订单-->
        <tr>
            <td style="text-align: center;">预约-乘客出发时间</td>
            <td><?php echo $result['book_time'];?></td>
            <td style="width:15%;text-align: center;">预约-司机出发时间</td>
            <td><?php if(!empty($result['depart_time'])):?><?php echo $result['depart_time'];?><?php else:?><span style="color: red">司机还未出发</span><?php endif;?></td>
        </tr>
        <tr>
            <td style="text-align: center;">预约-司机到达约定地点时间</td>
            <td colspan="3">
                <?php if(!empty($result['arrive_appointment_time']) && !empty($result['depart_time'])):?>
                    <?php echo $result['arrive_appointment_time'];?>
                <?php elseif(empty($result['arrive_appointment_time']) && !empty($result['depart_time'])):?>
                <span style="color: red">司机已出发 - 暂未到达</span>
                <?php else:?>
                等待司机出发
                <?php endif;?>
            </td>
        </tr>
        <?php else:?>
        <!--实时订单-->
        <tr>
            <td style="text-align: center;">司机接单时间</td>
            <td><?php echo $result['order_taker_time'];?></td>
            <td style="width:15%;text-align: center;">司机到达约定地点时间</td>
            <td><?php echo $result['arrive_appointment_time'];?></td>
        </tr>
        <?php endif;?>

        <?php if(!empty($result['arrive_appointment_time'])):?>
        <tr>
            <td style="width:15%;text-align: center;">上车时间</td>
            <td><?php echo $result['on_car_time'];?></td>
            <td style="width:15%;text-align: center;">下车时间</td>
            <td><?php echo $result['off_car_time'];?></td>
        </tr>
        <?php endif;?>

        <tr>
            <td style="width:15%;text-align: center;">司机姓名</td>
            <td><?php echo $result['driver_name'];?></td>
            <td style="width:15%;text-align: center;">司机手机号</td>
            <td><?php echo $result['driver_phone'];?></td>
        </tr>
        <tr>
            <td style="width:15%;text-align: center;">车牌号</td>
            <td><?php echo $result['car_plate'];?></td>
            <td style="width:15%;text-align: center;">车辆信息</td>
            <td><?php echo $result['car_info'];?></td>
        </tr>
        <tr>
            <td style="width:15%;text-align: center;">实际里程</td>
            <td><?php echo $result['real_distance'];?>（KM）</td>
            <td style="width:15%;text-align: center;">实际费用</td>
            <td><?php echo $result['real_fee'];?></td>
        </tr>
        <?php endif;?>

        <!--评价信息-->
        <?php if($result['orderStatus'] >= 50):?>
        <tr>
            <td colspan="10" style="color: green;">评价信息</td>
        </tr>
        <tr>
            <td style="width:15%;text-align: center;">评分</td>
            <td><?php echo $result['score'];?></td>
            <td style="width:15%;text-align: center;">评价内容</td>
            <td><?php echo $result['evaluate'];?></td>
        </tr>
        <tr>
            <td style="width:15%;text-align: center;">评价时间</td>
            <td colspan="8"><?php echo $result['evaluate_time'];?></td>
        </tr>

        <?php elseif($result['orderStatus'] == 45):?>
        <tr>
            <td colspan="10" style="color: green;">等待评价</td>
        </tr>
        <?php endif;?>

        <!--异常信息-->
        <?php if($result['orderStatus'] >= 15):?>
        <tr>
            <td colspan="10" style="color: green;">其他信息</td>
        </tr>
        <tr>
            <td style="width:15%;text-align: center;">迟到信息</td>
            <td><?php echo $result['information'];?></td>
            <td style="width:15%;text-align: center;">异常信息</td>
            <td><?php echo $result['abnormal'];?></td>
        </tr>
        <?php endif;?>

        <!--费用信息-->
        <?php if($result['orderStatus'] >= 45):?>
        <tr>
            <td colspan="10" style="color: green;">费用明细</td>
        </tr>
        <tr>
            <td style="width:15%;text-align: center;">付款状态</td>
            <td><?php echo $result['is_pay'];?></td>
            <td style="width:15%;text-align: center;">订单金额</td>
            <td><?php echo $result['original_price'];?></td>
        </tr>
        <tr>
            <td style="width:15%;text-align: center;">实际车费</td>
            <td><?php echo $result['driverMoney'];?></td>
            <td style="width:15%;text-align: center;">调度费</td>
            <td><?php echo $result['dispatch_fee'];?></td>
        </tr>
        <tr>
            <td style="width:15%;text-align: center;">优惠金额</td>
            <td><?php echo $result['coupon_price'];?> （<span style="color: green"><?php echo $result['coupon_info'];?></span>）</td>
            <td style="width:15%;text-align: center;">抵扣金额</td>
            <td><?php echo $result['gifts_money'];?></td>
        </tr>
        <tr>
            <td style="width:15%;text-align: center;">实付金额</td>
            <td><?php echo $result['need_price'];?></td>
            <td style="width:15%;text-align: center;">冻结金额</td>
            <td><?php echo $result['freeze_income'];?></td>
        </tr>
        <tr>
            <td style="width:15%;text-align: center;">支付时间</td>
            <td><?php echo $result['pay_time'];?></td>
            <td style="width:15%;text-align: center;">支付方式</td>
            <td><?php echo $result['payTypeName'];?></td>
        </tr>
        <tr>
            <td style="width:15%;text-align: center;">司机收入</td>
            <td><?php echo $result['driver_income'];?></td>
            <td style="width:15%;text-align: center;">平台费</td>
            <td><?php echo $result['platform_price'];?></td>
        </tr>
        <?php endif;?>
    </table>
</block>
